package com.sohu.peak.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DataFormat {
	private static SimpleDateFormat compactDate = new SimpleDateFormat(
			"yyyyMMdd");

	private static SimpleDateFormat ordDate = new SimpleDateFormat("yyyy-MM-dd");

	private static SimpleDateFormat ordSecond = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm:ss");

	private static SimpleDateFormat compactHmSecond = new SimpleDateFormat(
			"HHmmss");

	public static String compactDate(Date srcDate) {
		return compactDate.format(srcDate);
	}

	public static String ordDate(Date srcDate) {
		return ordDate.format(srcDate);
	}

	public static String ordSecond(Date srcDate) {
		return ordSecond.format(srcDate);
	}

	public static String compactHmSecond(Date srcDate) {
		return compactHmSecond.format(srcDate);
	}

	public static SimpleDateFormat getCompactDate() {
		return compactDate;
	}

	public static void setCompactDate(SimpleDateFormat compactDate) {
		DataFormat.compactDate = compactDate;
	}

	public static SimpleDateFormat getCompactHmSecond() {
		return compactHmSecond;
	}

	public static void setCompactHmSecond(SimpleDateFormat compactHmSecond) {
		DataFormat.compactHmSecond = compactHmSecond;
	}

	public static SimpleDateFormat getOrdDate() {
		return ordDate;
	}

	public static void setOrdDate(SimpleDateFormat ordDate) {
		DataFormat.ordDate = ordDate;
	}

	public static SimpleDateFormat getOrdSecond() {
		return ordSecond;
	}

	public static void setOrdSecond(SimpleDateFormat ordSecond) {
		DataFormat.ordSecond = ordSecond;
	}

}
